#pragma once

namespace UTIL {

class Properties
{
protected:
	CAtlMap<CString, CString> m_mapProperties;

public:
	Properties(void);
	Properties(LPCTSTR pszFileName);

	bool Load(LPCTSTR pszFileName);
	bool ParseString(const CStringA &strDataUTF8);

	bool IsEmpty() const
	{
		return m_mapProperties.IsEmpty();
	}

    size_t GetCount() const
    {
        return m_mapProperties.GetCount();
    }

	CString operator [] (const CString &strKey) const
	{
		return GetString(strKey);
	}

	CString &operator [] (const CString &strKey)
	{
		return m_mapProperties[strKey];
	}

	CString	GetString(const CString &strKey) const;
	int		GetInt(const CString &strKey) const;

    const CAtlMap<CString, CString>& GetMap() const
    {
        return m_mapProperties;
    }

    CAtlMap<CString, CString>& GetMap()
    {
        return m_mapProperties;
    }

protected:
	void ParseLine(CString strLine);
};

}; //namespace UTIL
